Edge node cluster network redundancy and fast convergence using an underlay anycast VTEP IP

ABSTRACT

Some embodiments provide a method for providing redundancy and fast convergence for modules operating in a network. The method configures modules to use a same anycast inner IP address, anycast MAC address, and to associate with a same anycast VTEP IP address. In some embodiments, the modules are operating in an active-active mode and all nodes running modules advertise the anycast VTEP IP addresses with equal local preference. In some embodiments, modules are operating in active-standby mode and the node running the active module advertises the anycast VTEP IP address with higher local preference.

CLAIM OF BENEFIT TO PRIOR APPLICATIONS

The present Application is a continuation application of U.S. patent application Ser. No. 15/443,974, filed Feb. 27, 2017, now published as U.S. Patent Publication 2018/0062914. U.S. patent application Ser. No. 15/443,974 claims the benefit of U.S. Provisional Patent Application 62/382,229, filed Aug. 31, 2016. U.S. patent application Ser. No. 15/443,974, now published as U.S. Patent Publication 2018/0062914, is incorporated herein by reference.

BACKGROUND

Networks provide services at service nodes. Clusters of service nodes are often used to provide redundancy so that service is not interrupted upon the failure of a single service node. During a failover process, the process of switching from a failed node to a redundant node, packets destined for the failed node may be dropped or may not be provided with the service. Therefore, methods for providing redundancy while minimizing failover time are needed.

BRIEF SUMMARY

Some embodiments provide a method for providing redundancy and fast convergence to modules (e.g., service routers) executing in edge nodes. In some embodiments the method is performed by a management plane that centrally manages the network (e.g., implemented in a network controller). The method, in some embodiments configures a set of service routers executing in edge nodes to use a same anycast inner internet protocol (IP) address and a same anycast inner media access control (MAC) address. In some embodiments, the method configures edge nodes on which the set of service routers are executing to use a same set of anycast virtual extensible local area network tunnel endpoint (VTEP) IP addresses. The method in some embodiments configures edge nodes to advertise the anycast inner IP and anycast inner MAC address as reachable through at least one anycast VTEP IP address.

In some embodiments, the method configures the service routers to act in active-standby mode in which one service router acts as an active service router and other service routers act as standby service routers in case the active service router is no longer accessible (e.g., the active service router fails or a connection to the active service router fails). In some embodiments, the method accomplishes this by configuring an edge node on which an active service router executes to advertise the anycast VTEP IP address with a higher local preference. In these embodiments, when the edge node fails, a switch connected to the edge node advertises that the anycast VTEP IP address is no longer reachable at the edge node. In other embodiments, the method configures the modules in active-active mode by configuring all edge nodes to advertise the anycast VTEP IP address with the same local preference.

In some embodiments, the method takes advantage of convergence of an underlay network to decrease failover times for redundant modules. Convergence time in the underlay network in some embodiments is based on link-failure detection protocols (e.g., bidirectional forwarding detection (BFD)) between the physical switches and machines on which the modules execute (e.g., an edge node or the host on which an edge node executes). Such underlay network failure detection in most cases will be much faster than software based methods operating between modules (50 ms vs. 1 second). Faster detection and fast convergence times for the hardware allows for decreased failover time for the modules.

The preceding Summary is intended to serve as a brief introduction to some embodiments of the invention. It is not meant to be an introduction or overview of all inventive subject matter disclosed in this document. The Detailed Description that follows and the Drawings that are referred to in the Detailed Description will further describe the embodiments described in the Summary as well as other embodiments. Accordingly, to understand all the embodiments described by this document, a full review of the Summary, Detailed Description and the Drawings is needed. Moreover, the claimed subject matters are not to be limited by the illustrative details in the Summary, Detailed Description and the Drawing, but rather are to be defined by the appended claims, because the claimed subject matters can be embodied in other specific forms without departing from the spirit of the subject matters.

BRIEF DESCRIPTION OF THE DRAWINGS

The novel features of the invention are set forth in the appended claims. However, for purpose of explanation, several embodiments of the invention are set forth in the following figures.

FIG. 1 illustrates a network that includes service modules, edge nodes, leaf switches, and spine switches in which the invention operates.

FIG. 2 illustrates a set of service modules using a same set of anycast addresses in a system configured as in FIG. 1 .

FIG. 3 illustrates a set of edge nodes implementing multiple pairs of service routers in active-standby mode using two anycast VTEP IP addresses.

FIG. 4 conceptually illustrates a process of some embodiments for configuring service modules to implement the invention.

FIG. 5 conceptually illustrates a process of some embodiments for implementing redundancy in case of service router failure.

FIG. 6 conceptually illustrates a process of some embodiments for implementing redundancy when service router comes back online.

FIG. 7 conceptually illustrates an electronic system with which some embodiments of the invention are implemented.

DETAILED DESCRIPTION

In the following description, numerous details are set forth for the purpose of explanation. However, one of ordinary skill in the art will realize that the invention may be practiced without the use of these specific details. In other instances, well-known structures and devices are shown in block diagram form in order not to obscure the description of the invention with unnecessary detail.

Some embodiments provide a method for providing redundancy and fast convergence to modules (e.g., service routers) executing in edge nodes. In some embodiments, the method is performed by a management plane that centrally manages the network (e.g., implemented in a network controller). The method, in some embodiments, configures a set of service routers executing in edge nodes to use a same anycast inner internet protocol (IP) address and a same anycast inner media access control (MAC) address. In some embodiments, the method configures edge nodes on which the set of service routers are executing to use a same set of anycast virtual extensible local area network tunnel endpoint (VTEP) IP addresses. The method configures edge nodes to advertise the anycast inner IP and anycast inner MAC address as reachable through at least one anycast VTEP IP address in some embodiments.

FIG. 1 illustrates a network system 100 in which some embodiments of the invention are implemented. FIG. 1 includes a number of host machines 101A-E, virtual extensible local area network tunnel endpoints (VTEPs) 102A-C, edge notes 105A-D, a service router 106, leaf switches 110A-D, hypervisor 115A, spine switches 120A-N, a data center fabric 130, and an external network 140. For simplicity, FIG. 1 only shows host machines 101A and B and edge node 105D with internal component, but one of ordinary skill in the art would understand that that other host machines and edge machines may contain similar, additional, or alternative elements.

Edge nodes 105A-D are connected to external network 140 and provide virtual machines or other data compute nodes connected to data center fabric 130 access to external network 140 by hosting service routers (e.g., service router 106). Service routers (SRs) may be implemented in a namespace, a virtual machine, or as a virtual routing and forwarding (VRF) module in different embodiments. Service routers provide routing services and, in some embodiments, a number of stateful (e.g., firewall, NAT, etc.) or stateless services (e.g., access control lists (ACLs)). In different embodiments, edge nodes 105A-D may be implemented as virtual machines (sometimes referred to as Edge VMs), in other types of data compute nodes (e.g., namespaces, physical hosts, etc.), or by using the Linux-based datapath development kit (DPDK) packet processing software (e.g., as a VRF in the DPDK-based datapath).

Edge nodes (e.g., edge node 105D) in some embodiments terminate tunnels (e.g., tunnels defined by a network manager). In some embodiments, some edge nodes (e.g., edge node 105C) make use of a VTEP of a host machine on which they execute while others implement their own VTEP when the edge node executes in a dedicated server. In some embodiments, edge nodes may be run on bare metal (e.g., directly on a server or host) or as a virtual machine form factor running on top of a hypervisor. One of ordinary skill in the art will understand that a network may include a number of edge nodes operating in any combination of the above modes.

Leaf physical switches 110C and 110D, in some embodiments, are part of data center fabric 130 and provide the VMs executing on host machines 101B-E access to spine switches 120 A-N and—through leaf physical switches 110A and 110B and edge nodes 105A-D—to external network 140. Leaf switches in some embodiments may be implemented as physical top of rack switches. In some embodiments, leaf switches and spine switches run internal gateway protocols (IGPs) (e.g., open shortest path first (OSPF), routing information protocol (RIP), intermediate system to intermediate system (IS-IS), etc.) to direct packets along a shortest path to a packet destination.

Host machines 101B-E in some embodiments host multiple VMs that use the edge nodes and service routers to access external network 140. VMs or other DCNs may be run on top of a hypervisor executing a managed switching element (not shown) that implements a VTEP and a virtual distributed router (VDR) to allow for overlay network and logical packet processing.

One of ordinary skill in the art would understand that the underlying network structure may be implemented in any number of ways that are consistent with the spirit of the invention. The particular network structure should not be construed as limiting the invention but is used solely for illustrative purposes.

FIG. 2 illustrates an instance of a set of service routers 206A-B executing on edge nodes 205A-B. FIG. 2 also illustrates a distributed router (DR) that spans edge nodes 205A-B and hypervisor 215. Hypervisor 215 also runs virtual machine 216 and terminates a tunnel at VTEP 202C. FIG. 2 also shows central controller 250 configuring a default route for DR 201 on hypervisor 215, and configures service routers 206A-B to use the anycast inner IP, MAC, and VTEP (outer) IP address. The DR, in some embodiments, spans managed forwarding elements (MFEs) that couple directly to VMs or other data compute nodes that are logically connected, directly or indirectly, to the logical router. The DR of some embodiments also spans the gateways to which the logical router is bound (e.g., edge nodes 205A-B). The DR is responsible for first-hop distributed routing between logical switches and/or other logical routers that are logically connected to the logical router. The SRs of some embodiments are responsible for delivering services that are not implemented in a distributed fashion (e.g., some stateful services).

Service routers 206A-B are shown connecting to logical switch 1. Service routers 206A-B in some embodiments are a subset of a set of SRs that provide access to external networks. Distributed router 201 connects to a plurality of logical switches (e.g., logical switches 1-N). Logical switches 2-N may be connected to VMs executing on any number of host machines. The VMs in some embodiments route traffic to an outside network through service routers 206A-B or a different set of SRs. Further details of possible configurations may be found in U.S. Non-Provisional patent application Ser. No. 14/814,473, published as United States Patent Publication 2016/0226754, which is hereby incorporated by reference.

As shown, SRs 206A-B are configured to use a same anycast inner IP address, anycast VTEP (outer) address, and anycast media access control (MAC) address. Anycast addressing allows a same address to be used for multiple destinations (in some embodiments of this invention the multiple destinations are redundant destinations). A packet sent to an anycast address is forwarded to a nearest node (also referred to as a closest node or along a shortest path) according to an IGP (e.g., OSPF, RIP, IS-IS, etc.). Such a nearest node along a route, in some embodiments, is calculated based on administrative distance values, used to determine priority, with larger values indicating lower priority types of route.

Service routers 206A-B may be implemented in active-active mode or active-standby mode. In active-active SRs are treated as equals for routing purposes (i.e., advertised with a same preference or administrative distance). Packet flows in active-active mode are directed to a particular SR based on some set of criteria (e.g., a load balancing criteria, equal-cost multi-pathing (ECMP), anycast routing protocol, etc.). Failure of a SR in active-active mode in some embodiments is detected by a bidirectional forwarding detection (BFD) session running between an edge node on which the SR executes and a switch to which the edge node is connected. After detection of the failure the switch no longer advertises the availability of the service router at the edge node for which the connection failed and the underlay network converges on remaining SRs as the shortest or lowest cost path to the anycast IP address. The system thus achieves redundancy and fast convergence by using an IGP and a same anycast address for all SRs. The specific steps are further discussed in relation to FIGS. 4-6 .

In some embodiments of the invention, SRs 206A-B are implemented in active-standby mode. In active-standby mode one service router in a set of service routers is configured to act as the active service router to which traffic destined for the set of service routers is directed. Such an active-standby mode may be useful when service routers provide stateful services that require a single service router to provide a set of services for each packet flow. In some situations, the active service router in such an active-standby mode maintains the state of all the flows. In some embodiments state information is periodically pushed to (or pulled by) the standby service routers to provide the set of services if the active service router fails. In active-standby mode the edge node hosting the active SR advertises its anycast VTEP IP address with a higher preference (e.g., lower administrative distance) than the edge node hosting the standby SR such that the active SR is always the “nearest” SR when both SRs are available.

In order to provide redundancy with fast convergence, some embodiments use bidirectional forwarding detection (BFD) or similar protocols for monitoring whether connections between leaf switches and edge nodes (and ultimately to the service routers) are functioning. Such protocols can have very short detection times (e.g., 50 ms). If a connection to an edge node hosting an active SR fails, routing information for the anycast addresses used by the active (failed) SR and the underlying network can converge on the use of the standby SR (as the available SR with the anycast addresses) at the same rate as the underlying network convergence, which in some embodiments is considerably faster than methods that rely on communication between the SRs. In some embodiments, the update is based on a notification from the BFD session.

This fast convergence can be contrasted with a process that relies on BFD sessions that run between SRs. BFD sessions that run between SRs to detect SR failure in both active-active and active-standby mode send packets less aggressively in order to avoid a false positive (i.e., detecting a failure that has not happened) based on a link failure in the underlay network that is subsequently corrected within an acceptable time. Even after a BFD session detects an actual failure, the SR must perform software processes to determine the appropriate action to take and then must send out a gratuitous address resolution protocol (GARP) packet that alerts all the servers and hypervisors of the new association of the MAC address of the failed SR with the IP address of the alternative SR. This process can take ten seconds or more because of the large number (hundreds or even thousands) of servers attached to a particular leaf physical switch as opposed to the method using the underlay network convergence which relies only on advertising the updated anycast address availability to the physical switches in the DC fabric.

One of ordinary skill in the art would understand that this method could be used to provide redundancy with fast convergence time to other types of module clusters that provide stateful or stateless services and is not limited to service routers in edge nodes.

Distributed router 201 is illustrated as spanning edge nodes 205A-B and as an element of hypervisor 215, however as described above DR (or virtual DR (VDR)) is a logical router that is implemented by managed forwarding elements executing on the hosts that are not shown in FIG. 2 . In some embodiments, DR 201 is configured to use as its default gateway the anycast inner IP address of the service routers 206A-B. In these embodiments, the anycast inner IP address is associated with the anycast MAC address and the anycast MAC address is associated with the anycast VTEP (outer) IP address. Configuring DR 201 to send packets to the anycast VTEP allows the underlying network to calculate the nearest node once the packet reaches the leaf switch 210C as discussed above.

VTEPs 202A-B are depicted as being part of pNICs 203A-B respectively because VTEPs advertise their availability on the IP address of the pNIC for the host machine. However, it is to be understood that in reality a VTEP is a function provided by a hypervisor or managed forwarding element on a hypervisor. Additionally, VTEPs are depicted as being connected to logical switch 1 to demonstrate that packets destined for the service routers on logical switch 1 are reachable by the VTEP acting on the same machine, and the VTEPs are also logically connected to any logical switch with DCNs running on the same machine or hypervisor.

FIG. 3 illustrates a configuration of edge nodes 305A-B on which multiple pairs of SRs execute. The use of two anycast VTEP addresses in some embodiments allows a single edge node to execute some SRs as active while other SRs are standby SRs. As in the example above, SR pairs in active-standby mode share anycast inner IP and MAC addresses (shown for SR 1 and SR 3) as well as anycast VTEP IP address. As shown, SR pairs that have the active SR on edge node 305A share VTEP1 as their anycast VTEP IP while SR pairs that have the active SR on edge node 305B share VTEP2 as their anycast VTEP IP. Such a configuration allows edge node 305A to advertise VTEP1 with higher preference and edge node 305B to advertise VTEP2 with higher preference such that the active SRs receive the traffic on both edge nodes.

FIG. 4 conceptually illustrates a process 400 that implements the novel method of some embodiments of the invention. In some embodiments, the process 400 is performed by a central controller or central controller cluster that manages forwarding elements on different hosts to implement logical networks and distributed routers. The controller performs this process in some embodiments upon an initial configuration of service routers and in other embodiments in response to a change in the network settings.

As shown, process 400 begins when a controller configures (at 410) a set of service routers to use a same anycast inner IP address. The anycast inner IP address is found in the inner packet header that is encapsulated according to a tunneling protocol (e.g., GRE, VXLAN, etc.). The process 400 then configures (at 420) the set of service routers to use a same anycast MAC address.

Process 400 continues by configuring (at 430) a set of edge nodes to use a same anycast VTEP (outer) IP address. One of ordinary skill in the art will appreciate that a VTEP IP address is just one example of an outer IP address that may be used in a tunneling protocol and that other outer IP addresses would function in similar manners. It is to be understood that the steps 410-430 may be performed in any order and that the separate steps are not dependent on one another.

The process determines (at 440) whether the service routers are to be configured in active-standby mode or in active-active mode. If the service routers are to be configured in active-standby mode, the process configures (at 450) the edge router on which the active service router executes to advertise the VTEP IP address with higher preference (e.g. lower administrative cost). If the process determines (at 440) that the service routers should be configured in active-active mode, the process (at 455) configures the edge nodes to advertise the VTEP IP address with a same preference (e.g., same administrative cost).

In both active-active and active-standby modes the process configures (at 460) distributed routers to use the anycast VTEP IP address to send outbound packets. As noted above in the discussion of FIG. 2 , in some embodiments the process configures the default route of the DR to direct packets to the anycast inner IP address by associating the anycast inner IP address with the anycast MAC address and anycast VTEP IP address used by the service router.

FIG. 5 conceptually illustrates a process 500 that implements the novel method of some embodiments of the invention. The process 500 in some embodiments is implemented by a leaf switch that is connected to an edge node on which an active service router is executing. The process allows fast detection of service-router unavailability (e.g., link between leaf switch and edge node fails, failure of edge node, etc.). Process 500 assumes that a bidirectional forwarding detection (BFD) or similar protocol for monitoring the status of the connection between the leaf switch and an edge node hosting a service router or routers has been established.

Process 500 begins by detecting (at 510) that a connection between a switch and an edge node has failed. In some embodiments, the connection is between a leaf switch and the edge node executing the active service router. One of ordinary skill in the art will recognize that the detection could be placed along any link that would leave the service router unavailable to other machines on the network.

Process 500 continues by having the switch remove (at 520) the association between the edge node and the anycast VTEP IP address from the forwarding table of the switch (e.g., based on a routing protocol). The switch no longer forwards packets with the anycast VTEP IP address to the edge node and the process proceeds to step 530.

Process 500 then determines (at 530) whether the anycast VTEP IP is still accessible on other machines (edge nodes) connected to the switch. If no other edge nodes connected to the switch advertise the availability of the anycast VTEP IP, then the process advertises (at 540) that the anycast VTEP IP is no longer available through the switch. Once this information is propagated through the DC fabric using a dynamic routing protocol, the underlying network begins sending packets to the next available service router (e.g., the standby router) and the process ends. If there are still edge nodes connected to the switch advertising the availability of the anycast VTEP IP, the switch does not need to advertise that the anycast VTEP IP address is not available through the switch and the process ends.

FIG. 6 conceptually illustrates a process 600 that allows a previously active service router to come back online as the active service router when availability is restored. The process 600 in some embodiments is implemented by a leaf switch that is connected to an edge node on which a formerly-active service router executes.

Process 600 begins by detecting (at 610) that a connection between a switch and an edge node has been restored. In some embodiments, the connection is between a leaf switch and the edge node executing the formerly-active service router. One of ordinary skill in the art will recognize that the detection could be placed along any link that would leave the service router unavailable to other machines on the network.

Process 600 continues by having the switch add (at 620) the association between the edge node and the anycast VTEP IP address to the forwarding table of the switch (e.g., based on a routing protocol). The addition in some embodiments is based on receiving an advertisement from the edge node that the anycast VTEP IP is available over the restored link. In some embodiments, the switch now forwards packets with the anycast VTEP IP address to the restored edge node and the process proceeds to step 630.

Process 600 then determines (at 630) whether the anycast VTEP IP was accessible on other machines (edge nodes) connected to the switch before the restoration of the connection. If no other edge nodes connected to the switch advertise the availability of the anycast VTEP IP, then the process advertises (at 640) that the anycast VTEP IP is now available through the switch. Once this information is propagated through the DC fabric using a dynamic routing protocol, the underlying network begins sending packets to the restored service router (e.g., the failed and restored active service router) and the process ends. If there were still edge nodes connected to the switch advertising the availability of the anycast VTEP IP, the switch does not need to advertise that the anycast VTEP IP address is now available through the switch and the process ends. In some embodiments, the edge node with the restored connection advertises the anycast VTEP IP address with higher preference as it had been doing before the failure and restoration.

Electronic System

Many of the above-described features and applications are implemented as software processes that are specified as a set of instructions recorded on a computer readable storage medium (also referred to as computer readable medium). When these instructions are executed by one or more processing unit(s) (e.g., one or more processors, cores of processors, or other processing units), they cause the processing unit(s) to perform the actions indicated in the instructions. Examples of computer readable media include, but are not limited to, CD-ROMs, flash drives, RAM chips, hard drives, EPROMs, etc. The computer readable media does not include carrier waves and electronic signals passing wirelessly or over wired connections.

In this specification, the term “software” is meant to include firmware residing in read-only memory or applications stored in magnetic storage, which can be read into memory for processing by a processor. Also, in some embodiments, multiple software inventions can be implemented as sub-parts of a larger program while remaining distinct software inventions. In some embodiments, multiple software inventions can also be implemented as separate programs. Finally, any combination of separate programs that together implement a software invention described here is within the scope of the invention. In some embodiments, the software programs, when installed to operate on one or more electronic systems, define one or more specific machine implementations that execute and perform the operations of the software programs.

FIG. 7 conceptually illustrates an electronic system 700 with which some embodiments of the invention are implemented. The electronic system 700 can be used to execute any of the control, virtualization, or operating system applications described above. The electronic system 700 may be a computer (e.g., a desktop computer, personal computer, tablet computer, server computer, mainframe, a blade computer etc.), phone, PDA, or any other sort of electronic device. Such an electronic system includes various types of computer readable media and interfaces for various other types of computer readable media. Electronic system 700 includes a bus 705, processing unit(s) 710, a system memory 725, a read-only memory 730, a permanent storage device 735, input devices 740, and output devices 745.

The bus 705 collectively represents all system, peripheral, and chipset buses that communicatively connect the numerous internal devices of the electronic system 700. For instance, the bus 705 communicatively connects the processing unit(s) 710 with the read-only memory 730, the system memory 725, and the permanent storage device 735.

From these various memory units, the processing unit(s) 710 retrieve instructions to execute and data to process in order to execute the processes of the invention. The processing unit(s) may be a single processor or a multi-core processor in different embodiments.

The read-only-memory (ROM) 730 stores static data and instructions that are needed by the processing unit(s) 710 and other modules of the electronic system. The permanent storage device 735, on the other hand, is a read-and-write memory device. This device is a non-volatile memory unit that stores instructions and data even when the electronic system 700 is off. Some embodiments of the invention use a mass-storage device (such as a magnetic or optical disk and its corresponding disk drive) as the permanent storage device 735.

Other embodiments use a removable storage device (such as a floppy disk, flash drive, etc.) as the permanent storage device. Like the permanent storage device 735, the system memory 725 is a read-and-write memory device. However, unlike storage device 735, the system memory is a volatile read-and-write memory, such a random access memory. The system memory stores some of the instructions and data that the processor needs at runtime. In some embodiments, the invention's processes are stored in the system memory 725, the permanent storage device 735, and/or the read-only memory 730. From these various memory units, the processing unit(s) 710 retrieve instructions to execute and data to process in order to execute the processes of some embodiments.

The bus 705 also connects to the input and output devices 740 and 745. The input devices enable the user to communicate information and select commands to the electronic system. The input devices 740 include alphanumeric keyboards and pointing devices (also called “cursor control devices”). The output devices 745 display images generated by the electronic system. The output devices include printers and display devices, such as cathode ray tubes (CRT) or liquid crystal displays (LCD). Some embodiments include devices such as a touchscreen that function as both input and output devices.

Finally, as shown in FIG. 7 , bus 705 also couples electronic system 700 to a network 765 through a network adapter (not shown). In this manner, the computer can be a part of a network of computers (such as a local area network (“LAN”), a wide area network (“WAN”), or an Intranet, or a network of networks, such as the Internet. Any or all components of electronic system 700 may be used in conjunction with the invention.

Some embodiments include electronic components, such as microprocessors, storage and memory that store computer program instructions in a machine-readable or computer-readable medium (alternatively referred to as computer-readable storage media, machine-readable media, or machine-readable storage media). Some examples of such computer-readable media include RAM, ROM, read-only compact discs (CD-ROM), recordable compact discs (CD-R), rewritable compact discs (CD-RW), read-only digital versatile discs (e.g., DVD-ROM, dual-layer DVD-ROM), a variety of recordable/rewritable DVDs (e.g., DVD-RAM, DVD-RW, DVD+RW, etc.), flash memory (e.g., SD cards, mini-SD cards, micro-SD cards, etc.), magnetic and/or solid state hard drives, read-only and recordable Blu-Ray® discs, ultra density optical discs, any other optical or magnetic media, and floppy disks. The computer-readable media may store a computer program that is executable by at least one processing unit and includes sets of instructions for performing various operations. Examples of computer programs or computer code include machine code, such as is produced by a compiler, and files including higher-level code that are executed by a computer, an electronic component, or a microprocessor using an interpreter.

While the above discussion primarily refers to microprocessor or multi-core processors that execute software, some embodiments are performed by one or more integrated circuits, such as application specific integrated circuits (ASICs) or field programmable gate arrays (FPGAs). In some embodiments, such integrated circuits execute instructions that are stored on the circuit itself.

As used in this specification, the terms “computer”, “server”, “processor”, and “memory” all refer to electronic or other technological devices. These terms exclude people or groups of people. For the purposes of the specification, the terms display or displaying means displaying on an electronic device. As used in this specification, the terms “computer readable medium,” “computer readable media,” and “machine readable medium” are entirely restricted to tangible, physical objects that store information in a form that is readable by a computer. These terms exclude any wireless signals, wired download signals, and any other ephemeral signals.

This specification refers throughout to computational and network environments that include virtual machines (VMs). However, virtual machines are merely one example of data compute nodes (DCNs) or data compute end nodes, also referred to as addressable nodes. DCNs may include non-virtualized physical hosts, virtual machines, containers that run on top of a host operating system without the need for a hypervisor or separate operating system, and hypervisor kernel network interface modules.

VMs, in some embodiments, operate with their own guest operating systems on a host using resources of the host virtualized by virtualization software (e.g., a hypervisor, virtual machine monitor, etc.). The tenant (i.e., the owner of the VM) can choose which applications to operate on top of the guest operating system. Some containers, on the other hand, are constructs that run on top of a host operating system without the need for a hypervisor or separate guest operating system. In some embodiments, the host operating system uses name spaces to isolate the containers from each other and therefore provides operating-system level segregation of the different groups of applications that operate within different containers. This segregation is akin to the VM segregation that is offered in hypervisor-virtualized environments that virtualize system hardware, and thus can be viewed as a form of virtualization that isolates different groups of applications that operate in different containers. Such containers are more lightweight than VMs.

Hypervisor kernel network interface modules, in some embodiments, is a non-VM DCN that includes a network stack with a hypervisor kernel network interface and receive/transmit threads. One example of a hypervisor kernel network interface module is the vmknic module that is part of the ESXi™ hypervisor of VMware, Inc.

It should be understood that while the specification refers to VMs, the examples given could be any type of DCNs, including physical hosts, VMs, non-VM containers, and hypervisor kernel network interface modules. In fact, the example networks could include combinations of different types of DCNs in some embodiments.

While the invention has been described with reference to numerous specific details, one of ordinary skill in the art will recognize that the invention can be embodied in other specific forms without departing from the spirit of the invention. In addition, a number of the figures (including FIGS. 4-6 ) conceptually illustrate processes. The specific operations of these processes may not be performed in the exact order shown and described. The specific operations may not be performed in one continuous series of operations, and different specific operations may be performed in different embodiments. Furthermore, the process could be implemented using several sub-processes, or as part of a larger macro process. Thus, one of ordinary skill in the art would understand that the invention is not to be limited by the foregoing illustrative details, but rather is to be defined by the appended claims. 

We claim:
 1. A method for configuring a plurality of host computers to implement a logical network in a datacenter, the logical network comprising a centralized logical router and a distributed logical router, the method comprising: configuring each edge node of a set of edge nodes that connect the datacenter to external networks to implement a centralized logical router, wherein each of the centralized logical routers uses a same first logical anycast network address; configuring (i) each of the edge nodes to use a same second physical anycast tunnel endpoint network address for a tunnel endpoint network address of the edge node and (ii) a particular edge node on which an active centralized logical router executes to advertise the second physical anycast tunnel endpoint network address to datacenter forwarding elements using a higher preference than other edge nodes in the set of edge nodes; and configuring each of a set of managed forwarding elements that execute on host computers to implement the distributed logical router (1) to use the first logical anycast network address of the centralized logical routers as a default gateway for the distributed logical router and (2) to send data messages that need to reach the centralized logical routers implemented by the edge node to the datacenter forwarding elements using the second physical anycast tunnel endpoint network address, the datacenter forwarding elements routing the data messages to the particular edge node.
 2. The method of claim 1, wherein the active centralized logical router is a first centralized logical router and the particular edge node is a first edge node, wherein upon failure of a connection to the first centralized logical router the datacenter forwarding elements route the data messages for the centralized logical routers to a second edge node on which a second centralized logical router executes.
 3. The method of claim 2, wherein the failure of the connection to the first centralized logical router is detected by a fault detection protocol session between the first edge node and one of the datacenter forwarding elements.
 4. The method of claim 2, wherein upon failure of the connection to the first centralized logical router, a datacenter forwarding element that detects the connection advertises the second physical anycast tunnel endpoint network address as unavailable at the first edge node.
 5. The method of claim 1 further comprising configuring the managed forwarding elements implementing the distributed logical router to associate data messages routed to the first logical anycast network address with the second physical anycast tunnel endpoint network address.
 6. The method of claim 1, wherein: the centralized logical routers that use the same first logical anycast network address are a first set of centralized logical routers; the particular edge node implements the active centralized logical router for the first set of centralized logical routers and an active centralized logical router for a second set of centralized logical routers; and the first logical anycast network address used by the first set of centralized logical routers and a third anycast network address associated with the second set of centralized logical routers are both associated with the second physical anycast tunnel endpoint network address.
 7. The method of claim 6, wherein: the particular edge node implements a standby centralized logical router for a third set of centralized logical routers that use a fourth anycast network address; the particular edge node uses both the second physical anycast tunnel endpoint network address and a fifth anycast tunnel endpoint network address; and the fourth anycast network address is associated with the fifth anycast tunnel endpoint network address.
 8. A non-transitory machine readable medium storing a program which when executed by at least one processing unit configures a plurality of host computers to implement a logical network in a datacenter, the program comprising sets of instructions for: configuring each edge node of a set of edge nodes that connect the datacenter to external networks to implement a centralized logical router, wherein each of the centralized logical routers uses a same first logical anycast network address; configuring (i) each of the edge nodes to use a same second physical anycast tunnel endpoint network address for a tunnel endpoint network address of the edge node and (ii) a particular edge node on which an active centralized logical router executes to advertise the second physical anycast tunnel endpoint network address to datacenter forwarding elements using a higher preference than other edge nodes in the set of edge nodes; and configuring each of a set of managed forwarding elements that execute on host computers to implement the distributed logical router (1) to use the first logical anycast network address of the centralized logical routers as a default gateway for the distributed logical router and (2) to send data messages that need to reach the centralized logical routers implemented by the edge node to the datacenter forwarding elements using the second physical anycast tunnel endpoint network address, the datacenter forwarding elements routing the data messages to the particular edge node.
 9. The non-transitory machine readable medium of claim 8, wherein the active centralized logical router is a first centralized logical router and the particular edge node is a first edge node, wherein upon failure of a connection to the first centralized logical router the datacenter forwarding elements route the data messages for the centralized logical routers to a second edge node on which a second centralized logical router executes.
 10. The non-transitory machine readable medium of claim 9, wherein the failure of the connection to the first centralized logical router is detected by a fault detection protocol session between the first edge node and one of the datacenter forwarding elements.
 11. The non-transitory machine readable medium of claim 9, wherein upon failure of the connection to the first centralized logical router, a datacenter forwarding element that detects the connection advertises the second physical anycast tunnel endpoint network address as unavailable at the first edge node.
 12. The non-transitory machine readable medium of claim 8, wherein the program further comprises a set of instructions for configuring the managed forwarding elements implementing the distributed logical router to associate data messages routed to the first logical anycast network address with the second physical anycast tunnel endpoint network address.
 13. The non-transitory machine readable medium of claim 8, wherein: the centralized logical routers that use the same first logical anycast network address are a first set of centralized logical routers; the particular edge node implements the active centralized logical router for the first set of centralized logical routers and an active centralized logical router for a second set of centralized logical routers; and the first logical anycast network address used by the first set of centralized logical routers and a third anycast network address associated with the second set of centralized logical routers are both associated with the second physical anycast tunnel endpoint network address.
 14. The non-transitory machine readable medium of claim 13, wherein: the particular edge node implements a standby centralized logical router for a third set of centralized logical routers that use a fourth anycast network address; the particular edge node uses both the second physical anycast tunnel endpoint network address and a fifth anycast tunnel endpoint network address; and the fourth anycast network address is associated with the fifth anycast tunnel endpoint network address. 